forum

home / developersection / forums / using set in a c# class

Using set in a C# class

Anonymous User 2243 06-Apr-2013
Hi Expert!
I have the following class:
public class Class1
{
    private int pam1;
    public Class1()
    {
    }
    public void ChangePam1(int _NewValue)
    {
        UpdatePam1(_NewValue);
        pam1 = _NewValue;
    }
    public int Pam1
    {
        set { this.pam1 = value; }
        get { return this.pam1; }
    }
}
Currently, when I want to change the value of Pam1, I do the following:
int n = 500;
Class1 c1 = new Class1();
c1.ChangePam1(n);
How can I change it using Set?

c# c# 
Updated on 06-Apr-2013

I am a content writter !


Message
Can you answer this question?

Answer

2 Answers

Liked By